package com.example.demo.demoEntity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "t_permission", schema = "tc40", catalog = "")
public class TPermissionEntity {
    private int id;
    private String permissionsName;
    private String url;

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "permissions_name", nullable = true, length = 255)
    public String getPermissionsName() {
        return permissionsName;
    }

    public void setPermissionsName(String permissionsName) {
        this.permissionsName = permissionsName;
    }

    @Basic
    @Column(name = "url", nullable = true, length = 255)
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) return false;
        TPermissionEntity that = (TPermissionEntity) o;
        return id == that.id && Objects.equals(permissionsName, that.permissionsName) && Objects.equals(url, that.url);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, permissionsName, url);
    }
}
